package com.seqb.manage.file.domain;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.seqb.common.dto.CommDTO;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * @author lilinshen
 * @title 文件管理表
 * @description 请填写相关描述
 * @date 2019/11/15
 */
@Data
@TableName("t_file")
public class FileDO extends CommDTO implements Serializable {
    private static final long serialVersionUID = 1L;

    //唯一编号
    private Long id;
    //文件类型
    private String fileType;
    //URL地址
    private String fileUrl;
    //文件名
    private String fileName;
    //文件大小
    private Long fileSize;
    //对应表ID
    private Long domainId;
    //对应表名
    private String domainName;
    //对应表字段
    private String domainField;
    //创建者编号
    @TableField(fill = FieldFill.INSERT)
    private Long createNumber;
    //创建时间
    @TableField(fill = FieldFill.INSERT)
    private Date createDate;
    //修改时间
    @TableField(fill = FieldFill.INSERT_UPDATE, update = "now()")
    private Date updateDate;
    //是否删除(0-否，1-是)
    @TableLogic
    @TableField(fill = FieldFill.INSERT)
    private String isDelete;
    //版本号
    @TableField(fill = FieldFill.INSERT_UPDATE, update = "%s+1")
    private Long version;

    public FileDO() {
    }

    public FileDO(String fileType, String fileUrl, String fileName, Long fileSize, Long domainId, String domainName, String domainField) {
        super();
        this.fileType = fileType;
        this.fileUrl = fileUrl;
        this.fileName = fileName;
        this.fileSize = fileSize;
        this.domainId = domainId;
        this.domainField = domainField;
        this.domainName = domainName;
    }

    public FileDO(String fileType, String fileUrl, String fileName, Long fileSize) {
        super();
        this.fileType = fileType;
        this.fileUrl = fileUrl;
        this.fileName = fileName;
        this.fileSize = fileSize;
    }
}
